import React from 'react'
import classNames from 'classnames'
import { View, Text } from '@tarojs/components'
import { math } from "@/utils/math"
import './index.scss'
export default (props: { price: string | number, type: 'lineation' | 'sale' | 'gray' | 'graybold' }) => {
  let { price, type } = props
  price = Number(price)
  return (
    <View className={classNames(['price', type === 'lineation' && 'lineation', type === 'gray' && 'gray', type === 'graybold' && 'graybold'])}>
      <Text className='unit'>¥</Text>
      <Text className='number'>
        {math.format(price / 100)}
      </Text>
    </View>
  )
}
